/*
 * @Description: jishupu-admin-template
 * @Author: 技术铺<jishupu@qq.com>
 * @Date: 2022-03-03
 */
const { success } = require('./utils')

// 留言咨询模块
module.exports = [
  // 列表
  {
    url: '/v1/guestbook$',
    type: 'get',
    response: config => {
      const result = {
        'items': [
          {
            'id': 2,
            'customer_name': '李女士',
            'customer_phone_number': '18888888888',
            'customer_email': '9999@qq.com',
            'message': '消息2',
            'remark': '已处理',
            'status': 0,
            'created_at': '2021-12-29 00:00:00',
            'updated_at': '2021-12-29 00:00:00'
          },
          {
            'id': 1,
            'customer_name': '李先生',
            'customer_phone_number': '18888888888',
            'customer_email': '8888@qq.com',
            'message': '消息1',
            'remark': '备注',
            'status': 0,
            'created_at': '2021-12-29 00:00:00',
            'updated_at': '2021-12-29 00:00:00'
          }
        ],
        'meta': {
          'current_page': 1,
          'last_page': 1,
          'per_page': '20',
          'total': 2
        }
      }
      return success(result)
    }
  },
  // 模拟修改状态
  {
    url: '/v1/guestbook/\\d+/status',
    type: 'patch',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟删除
  {
    url: '/v1/guestbook/\.*',
    type: 'delete',
    response: config => {
      return success({}, '删除成功')
    }
  }
]
